`
https://leetcode.cn/problems/maximum-depth-of-n-ary-tree/
`

/**
 * // Definition for a _Node.
 * function _Node(val,children) {
 *    this.val = val === undefined ? null : val;
 *    this.children = children === undefined ? null : children;
 * };
 */

/**
 * @param {_Node|null} root
 * @return {number}
 */
var maxDepth = function (root) {
  if (root === null) return 0

  let subTreeMaxDepth = 0
  for (const c of root.children) {
    subTreeMaxDepth = Math.max(subTreeMaxDepth, maxDepth(c))
  }

  return subTreeMaxDepth + 1
};